import json
import socket



"""1: OK and Cancel
2: Abort, Retry, Ignore
3: Yes, No, Cancel
4: Yes and No
5: Retry and Cancel
16: Critical message icon    
32: Warning query icon
48: Warning message icon
64: Information message icon
4096: Always stay on top of the desktop
"""
request = json.dumps({
    "header": {
        "type": 11
    },
    "body": {
        "type": 16,
        "text": "Hello World!",
        "title": "Hi",
        "amount": 100,
        "filepath": "test.vbs"
    }
})


sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(('localhost', 9090))
sock.listen(1)

conn, _ = sock.accept()

conn.send(request.encode())

data = conn.recv(1024)
conn.close()

json_data = json.loads(data.decode())
print(json_data["body"]["response"])
